// Burn interface, added by regret
#ifndef _BURNINTERFACE_H_
#define _BURNINTERFACE_H_

// interface
class IInterface {
public:
	IInterface() {}
	virtual ~IInterface() {}
};

// rom loader
class IRomLoader : public IInterface {
public:
	virtual int loadRom(unsigned char* dest, unsigned* wrote, unsigned i) = 0;
	virtual int loadOneRom(const char* arcName, const char* fileName, void** dest, unsigned* wrote) = 0;

	IRomLoader() {}
	virtual ~IRomLoader() {}
};

// auto fire
class IAutofire : public IInterface {
public:
	virtual void init() = 0;
	virtual void run() = 0;

	IAutofire() {}
	virtual ~IAutofire() {}
};

// progress
class IProgress : public IInterface {
public:
	virtual bool range(double _range) = 0;
	virtual bool update(double progress, const char* text, bool abs) = 0;

	IProgress() {}
	virtual ~IProgress() {}
};

// patch
class IPatch : public IInterface {
public:
	virtual void apply(unsigned char* base, const char* name, unsigned len) = 0;

	IPatch() {}
	virtual ~IPatch() {}
};

// misc
class IMisc : public IInterface {
public:
	IMisc() {}
	virtual ~IMisc() {}
};


// ---------------------------------------------------------------------------
// interfaces
class BurnInterface {
public:
	BurnInterface() {
		inRomLoader = 0;
		inAutofire = 0;
		inProgress = 0;
		inPatch = 0;
		inMisc = 0;
	}
	virtual ~BurnInterface() {}

	void setIRomLoader(IRomLoader* p) { inRomLoader = p; }
	void setIAutofire(IAutofire* p) { inAutofire = p; }
	void setIProgress(IProgress* p) { inProgress = p; }
	void setIPatch(IPatch* p) { inPatch = p; }
	void setIMisc(IMisc* p) { inMisc = p; }

	IRomLoader* getIRomLoader() { return inRomLoader; }
	IAutofire* getIAutofire() { return inAutofire; }
	IProgress* getIProgress() { return inProgress; }
	IPatch* getIPatch() { return inPatch; }
	IMisc* getIMisc() { return inMisc; }

private:
	IRomLoader* inRomLoader;
	IAutofire* inAutofire;
	IProgress* inProgress;
	IPatch* inPatch;
	IMisc* inMisc;
};

extern BurnInterface burnInterface;

#endif
